package server;

import java.util.HashMap;

/**
 * @author Dymitr Załunin
 */

public class GameRepository {
	
	private HashMap<String, GamePool> games;
	
	private static GameRepository instance;
	
	private GameRepository() {
		games=new HashMap<String, GamePool>();
	}
	
	synchronized public static GameRepository getInstahce() {
		if (instance==null) 
			instance=new GameRepository();
		return instance;
	} 
	
	public void addGamePool(String gameType, GamePool pool) {
		games.put(gameType, pool);
	}
	
	public GamePool getGamePool (String gameType) {
		return games.get(gameType);
	}
	
}